package cn.vastbase.jdbc.ddl;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class PrepareDdlTestCase {

    @Test
    public void testSelectSequenceNextValue() {
        String url = "jdbc:postgresql://192.168.56.17:6000/test?loggerLevel=off";
        String username = "test";
        String passwd = "Vastdata#0730";
        try (Connection conn = DriverManager.getConnection(url, username, passwd)) {
            try (PreparedStatement ps = conn.prepareStatement("create sequence res_seq;")) {
                ps.executeUpdate();
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
            try (PreparedStatement ps = conn.prepareStatement("create sequence res_seq;")) {
                ps.executeUpdate();
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
        } catch (Exception e) {

        }

    }
}
